//
//  NSFileManager+ZLCategory.h
//  ZLCategory
//
//  Created by zhaozl on 2022/3/7.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSFileManager (ZLCategory)

/// app路径
+ (NSString *)zl_getAppDirectoryPath;

/// 程序包内资源路径
/// @param resource 路径
+ (NSString *)zl_getMainBundleResource:(NSString *)resource;

/// 路径下为.plist文件，直接读写操作
/// @param path 路径
/// @param object 对象
/// @param key 键值
+ (BOOL)zl_setDicPath:(NSString *)path object:(id)object forKey:(NSString *)key;

/// 路径下为.plist文件，直接读写操作
/// @param path 路径
/// @param key 键值
+ (id)zl_getDicPath:(NSString *)path key:(NSString *)key;

/// 文件夹大小
/// @param path 路径
+ (CGFloat)zl_directorySizeAtPath:(NSString *)path;

/// 文件大小
/// @param path 路径
+ (CGFloat)zl_fileSizeAtPath:(NSString *)path;

/// 删除文件\文件夹
/// @param path 路径
+ (BOOL)zl_delFiles:(NSString *)path;

/// 获取BUNDLE资源文件
/// @param bundlePath BUNDLE路径
/// @param file 文件名称
+ (NSString *)zl_getFileFromBundle:(NSString *)bundlePath file:(NSString *)file;

/// home目录
/// @param folder folder
/// @param fileName 文件名称
+ (NSString *)zl_getHomeFolder:(NSString *)folder file:(NSString *)fileName;

/// home/library
/// @param folder folder
/// @param fileName 文件名称
+ (NSString *)zl_getLibraryFolder:(NSString *)folder file:(NSString *)fileName;

/// home/library/preferences
/// @param folder folder
/// @param fileName 文件名称
+ (NSString *)zl_getPreferencesPanesFolder:(NSString *)folder file:(NSString *)fileName;

/// home/library/caches
/// @param folder folder
/// @param fileName 文件名称
+ (NSString *)zl_getCachesFolder:(NSString *)folder file:(NSString *)fileName;

/// home/tmp
/// @param folder folder
/// @param fileName 文件名称
+ (NSString *)zl_getTempFolder:(NSString *)folder file:(NSString *)fileName;

/// 获取文件夹（没有则创建）
/// @param folder 路径
+ (NSString *)zl_getDocumentPath:(NSString *)folder;

/// 判断文件是否存在
/// @param filePath 文件路径
+ (BOOL)zl_hasFile:(NSString *)filePath;

@end

NS_ASSUME_NONNULL_END
